HADOOP_HOME=/home/kelvin/hadoop

jar: compile
	cd bin; jar cf ../inverted_index.jar *; cd ..

compile: src/kelvin/invertedindex/InvertedIndex.java
	javac -classpath $(HADOOP_HOME)/hadoop-core-0.20.203.0.jar:$(HADOOP_HOME)/lib/commons-cli-1.2.jar src/kelvin/invertedindex/InvertedIndex.java -d bin/

run: jar
	- $(HADOOP_HOME)/bin/hadoop dfs -rmr inverted_index/output
	$(HADOOP_HOME)/bin/hadoop jar inverted_index.jar kelvin.invertedindex.InvertedIndex inverted_index/input inverted_index/output

output:
	$(HADOOP_HOME)/bin/hadoop dfs -cat inverted_index/output/part*
